Various techniques have been suggested for measuring, without contact, a depth of a three-dimensional scene, that is, a distance to each subject. Such techniques can be largely classified into a positive technique and a passive technique. The positive technique is to irradiate the subject with infrared rays, ultrasound, or laser, and calculate a distance to the subject based on a length of time until a wave which is reflected returns or an angle of the reflected wave. The passive technique is to calculate the distance based on an image of the subject. Particularly, in the case of using a camera to measure the distance to the subject, the passive technique which does not require an apparatus for emitting infrared rays and so on is widely used.
Various passive techniques have been suggested, one of which is referred to as Depth from Defocus (DFD) which is a technique to measure the distance based on a blur generated by focus change. DFD has features such as not requiring a plurality of cameras, allowing distance measurement using a small number of images, and so on.
DFD is a distance measuring technique using image blur, but there is a problem that it is extremely difficult to judge, from the captured image alone, whether the blur in the captured image was caused by change in lens focus or whether an original image which represents a state without lens-derived blur has a blurred texture from the beginning.
To deal with this, Patent Literature 1 discloses a distance measuring method independent of a spectral component of the original image, which is to compare a ratio between each of a plurality of captured images in a spatial frequency spectrum and a ratio of the blur corresponding to the depth of the scene in spatial frequency spectrum.
On the other hand, Patent Literature 2 discloses a technique to obtain a reference image corresponding to the original image by capturing a large number of images by changing focus and extracting only focused portions of the images. The distance is measured by configuring a scale space in which various blurs are convolved into this reference image and comparing the reference image and captured image on the scale space. In short, the distance measurement is performed by comparing the degrees of blur of the reference image and the captured image.